﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Milan.Deploy;
using System.Threading;

namespace HelloWorld
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			System.Windows.Forms.Application.EnableVisualStyles();
			System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
			Milan.Forms.LogDisplay.ThrowUp();
			Milan.Forms.SplashScreen.ThrowUp();
			Milan.Forms.SplashScreen.NumberOfSteps = 3;
			Package package = new Package();
			package.Files.Add(new Package.File("HelloWorld.exe", "HelloWorld.exe"));
			package.Files.Add(new Package.File("Milan.dll", "Milan.dll"));
			package.Files.Add(new Package.File("milanforms.dll","milanforms.dll"));
			package.Links.Add(new Package.Link("Milan Hello World", "HelloWorld", "", "HelloWorld.exe", "HelloWorld.exe", "HelloWorld.exe"));
			if (package.UploadIfNew())
				MessageBox.Show("Uploaded project to server.");
			Milan.Forms.SplashScreen.Step = 1;
			Milan.log.Error("This is a test of an error");
			Milan.Forms.SplashScreen.Step = 2;
			using (Milan.Deploy.LocalUserOnly application = new Milan.Deploy.LocalUserOnly(null))
			{
				Milan.Forms.SplashScreen.Step = 3;
				Milan.Forms.SplashScreen.TakeDown();
				System.Windows.Forms.Application.Run(new MainForm());
			}
			Milan.Forms.LogDisplay.TakeDown();
		}
	}
}
